package com.wn.date20190809;
/**
 * 
 * @author song
 *
 */
public class Army
{
	Weapon[] weapons;
	int count=0;// 计数
	public Army(int num)
	{
		this.weapons=new Weapon[num];
	}
	public boolean addWeapon(Weapon weapon )
	{
		if(count<10)
		{
			weapons[count]=weapon;
			count++;
			System.out.println("武器添加成功");
			return true;
		}
		return false;
	}
	public void attactAll()
	{
		for(int i=0;i<count;i++)
		{
			weapons[i].attact();
		}
	}
	public void moveAll()
	{
		for(int i=0;i<count;i++)
		{
			weapons[i].move();
		}
	}
}
